// draggable
export default {
    name: "draggable",
    mounted(el) {
        el.style.cursor = "move";
        el.onmousedown = (e) => {
            let disX = e.clientX - el.offsetLeft;
            let disY = e.clientY - el.offsetTop;
            document.onmousemove = (e) => {
                let left = e.clientX - disX;
                let top = e.clientY - disY;
                el.style.left = left + "px";
                el.style.top = top + "px";
            };
            document.onmouseup = () => {
                document.onmousemove = null;
                document.onmouseup = null;
            };
        };
    },
};